import validateMap from '@/utils/validate'

const customFormRules = {
  Hotel_id: [
    { required: true, message: '请输入酒店编号', trigger: 'blur' },
    {
      validator: (
        rule: any,
        value: string,
        callback: (arg0: Error | undefined) => any
      ) => {
        validateMap.$validLength(value, callback, 20)
      },
      trigger: 'blur'
    }
  ],
  Name: [
    { required: true, message: '请输入账号/手机号', trigger: 'blur' },
    {
      validator: (
        rule: any,
        value: string,
        callback: (arg0: Error | undefined) => any
      ) => {
        validateMap.$validLength(value, callback, 20)
      },
      trigger: 'blur'
    }
  ],
  Pwd: [
    { required: true, message: '请输入密码', trigger: 'blur' },
    {
      validator: (
        rule: any,
        value: string,
        callback: (arg0: Error | undefined) => any
      ) => {
        validateMap.$validLength(value, callback, 20)
      },
      trigger: 'blur'
    }
  ],
  ValidCode: [
    { required: true, message: '请输入验证码', trigger: 'blur' },
    {
      validator: (
        rule: any,
        value: string,
        callback: (arg0: Error | undefined) => any
      ) => {
        validateMap.$validLength(value, callback, 20)
      },
      trigger: 'blur'
    }
  ]
}
export default customFormRules
